
import pymysql

conn = pymysql.connect(
    host='127.0.0.1',
    port=3306,
    user='root',
    password='666',
    database='day43',
    charset='utf8',

)

cursor = conn.cursor(pymysql.cursors.DictCursor)

sql = "insert into t1 values (3,'xx3',18);"

ret = cursor.execute(sql)

print(ret)

# 增删改都必须进行提交操作(commit)
conn.commit()








